package edu.whut.arraysTest;

import java.util.Arrays;

public class BubbleSort {
    public static void main(String[] args) {
        int[] nums = {1,2,3,4};
        for(int i = nums.length-1; i>0;i--){
            for(int j = 0;j<i;j++){
                if(nums[j]>nums[j+1]){
                    int t = nums[j];
                    nums[j] = nums[j+1];
                    nums[j+1] = t;
                }
            }
        }
        System.out.println(Arrays.toString(nums));
    }

}
